if (typeof commentReply == 'undefined') {
  var commentReply = {};      
}

commentReply.$ = function(id) {
  return document.getElementById(id);
}

commentReply.notificationSwitch = function(e) {
  var prefix = 'atreplymailnotification_';
  if (e.checked) {
    commentReply.$(prefix + '1').disabled = false;
    commentReply.$(prefix + '2').disabled = false;
  } else {
    commentReply.$(prefix + '1').disabled = true;
    commentReply.$(prefix + '2').disabled = true;
  }
}

commentReply.replyto = function(commentid, commenter) {
  var txtarea = commentReply.$('comment');
  txtarea.value += '<a class="replyto" href="#comment-' + commentid + '">@' + commenter + ':</a> ';
  window.location.href = window.location.href.split('#')[0] + '#commentform';
  txtarea.focus();
}  